Skip to content

Misc cleanups around Netty4HttpPipeliningHandler#104642

Merged
DaveCTurner merged 3 commits intoelastic:mainfrom
DaveCTurner:2024/01/23/Netty4HttpPipeliningHandler-cleanups
Jan 24, 2024
Merged

Misc cleanups around Netty4HttpPipeliningHandler#104642
DaveCTurner merged 3 commits intoelastic:mainfrom
DaveCTurner:2024/01/23/Netty4HttpPipeliningHandler-cleanups

Conversation

@DaveCTurner
Copy link
Copy Markdown
Member

  • Make Netty4HttpResponse sealed, we need to know all its impls
  • Rename Netty4FullHttpResponse to contrast with chunked response
  • Rename doWrite overloads
  • Reorder finishChunkedWrite(), we're ready to handle the next
    response before completing the promise
  • Add missing test for splitting large responses
  • Add a few extra assertions
  • Clean up IDE warnings

- Make `Netty4HttpResponse` sealed, we need to know all its impls
- Rename `Netty4FullHttpResponse` to contrast with chunked response
- Rename `doWrite` overloads
- Reorder `finishChunkedWrite()`, we're ready to handle the next
  response before completing the promise
- Add missing test for splitting large responses
- Add a few extra assertions
- Clean up IDE warnings
@DaveCTurner DaveCTurner added >non-issue :Distributed/Network Http and internode communication implementations v8.13.0 labels Jan 23, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Meta label for distributed team. label Jan 23, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@DaveCTurner DaveCTurner requested a review from pxsalehi January 23, 2024 09:15
Copy link
Copy Markdown
Member

@pxsalehi pxsalehi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (although I am still getting to learn this area, so it might worth waiting for a second one).

embeddedChannel.writeAndFlush(response, promise);
assertTrue(promise.isDone());
assertThat(messagesSeen, hasSize(1));
assertSame(response, messagesSeen.get(0));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also assert that the seen message is an instance of full HTTP response?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep can do, see 5d30ae9

Copy link
Copy Markdown
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

import org.elasticsearch.http.HttpResponse;

public interface Netty4RestResponse extends HttpResponse, HttpMessage {
public sealed interface Netty4RestResponse extends HttpResponse, HttpMessage permits Netty4FullHttpResponse, Netty4ChunkedHttpResponse {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename this interface to Nett4HttpResponse since the other class is now called Netty4FullHttpResponse? The usage of Rest is inconsistent with other classes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it was a little noisy to do that in this same PR, I opened #104675.

Copy link
Copy Markdown
Contributor

@Tim-Brooks Tim-Brooks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DaveCTurner DaveCTurner merged commit cf67f5d into elastic:main Jan 24, 2024
@DaveCTurner DaveCTurner deleted the 2024/01/23/Netty4HttpPipeliningHandler-cleanups branch January 24, 2024 08:13
@DaveCTurner
Copy link
Copy Markdown
Member Author

FWIW this was opened to prepare things for #104851.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Network Http and internode communication implementations >non-issue Team:Distributed Meta label for distributed team. v8.13.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants